<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2018/12/19
  Time: 10:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="js/jquery-3.3.1.js"></script>
<body>
<h3>入门案例</h3>
<%--./book/demo1--%>
<%--<a href="./book/demo1?username=zhangsan&age=23">入门程序</a>--%>
<a href="./book/demo5">入门程序</a>
</body>
<br>
<form action="/book/demo2" method="post">
    bookName:<input type="text" name="bookName"><br>
    author:<input type="text" name="author"><br>
    company:<input type="text" name="company"><br>

<%--ognl表达式--%>
    <%-- kind_name:<input type="text" name="kind.kind_name"><br>--%>
    kind_name:<input type="text" name="list[0].kind_name"><br>
    kind_name:<input type="text" name="maps['shsh'].kind_name"><br>
    <button type="submit">button</button>
</form>

<form action="/book/demo3"method="post">
    书名:<input type="text" name="bookName"><br>
    出版社:<input type="text" name="company"><br>
    价格:<input type="text" name="price"><br>

    种类:<input type="text" name="kinds[0].kind_name"/><br>
    map1:<input type="text" name="maps['ss']"/><br>
    map2:<input type="text" name="maps['aa']"/><br>
    <button type="submit">button</button>
</form>

<br>
<hr>
<form action="/book/demo4" method="post">
    日期:<input type="text" name="birthday"/>
    <input type="submit" value="点击提交"><br>
</form>
<%--Servlet原生的API--%>
<a href="./book/demo5">Servlet原生的API</a><br>
<%--restful参数传值--%>

<a href="/book/demo6/" ?name="tom" $age="10">demo6</a>
<a href="/book/demo6/tom/10">demo6</a><br>
<a href="/book/demo8">demo8</a><br>
<%--modelAttribute--%>

<a href="/book/demo9"?bookName="java">demo9</a><br>

<a href="/book/demo10">request</a><br>
<a href="/kind/ kind1">重定向</a><br>
<a href="/kind/ kind3">转发</a>
<a href="/kind/ kind5">add</a>
<a href="/kind/ kind6">del</a><br>
<a href="/hello/demo1">异常处理</a><br>
<a href="/hello/demo2">拦截器</a>


<button id="btn">button</button><br>


</html>
<script>
    $("#btn").click(function () {

        // alert("111")
        $.ajax({
            //编写jason格式
            url: "/kind/kind4",
            data: {kind_name: "harden", id: 20},
            type: "post",
            datatype: "json",
            success: function (msg) {

                alert(msg.bookName);
                alert(msg.price);
            }
        })

    })
</script>
